using System;
using System.ComponentModel;

namespace ClassBuilderWizard.Interfaces
{
    public class DatabaseColumn
    {
        private string _Name;
        private bool _IsReadOnly;
        private Type _CLRType;
        private bool _IsNullable;
        private int _MaxLength;
        private int _NumericPrecision;
        private int _NumericScale;
        private bool _IsIdentity;
        private string _DatabaseTypeName;
        private string _DatabaseTypeDeclaration;

        public DatabaseColumn()
        {
            this._Name = string.Empty;
            this._CLRType = typeof(string);
            this._DatabaseTypeName = string.Empty;
        }

        /// <summary>
        /// The name of the database column
        /// </summary>
        [Category("General")]
        public string Name
        {
            get { return this._Name; }
            set { this._Name = value; }
        }
        /// <summary>
        /// True if the database column is read-only
        /// </summary>
        [Category("Attributes")]
        public bool IsReadOnly
        {
            get { return this._IsReadOnly; }
            set { this._IsReadOnly = value; }
        }
        /// <summary>
        /// The database column's Dot Net data type
        /// </summary>
        [Category("Data Type")]
        public Type CLRType
        {
            get { return this._CLRType; }
            set { this._CLRType = value; }
        }
        /// <summary>
        /// True if the database column is nullable
        /// </summary>
        [Category("Attributes")]
        public bool IsNullable
        {
            get { return this._IsNullable; }
            set { this._IsNullable = value; }
        }
        /// <summary>
        /// The maximum number of characters allowed by the database column
        /// </summary>
        [Category("Data Type")]
        public int MaxLength
        {
            get { return this._MaxLength; }
            set { this._MaxLength = value; }
        }
        /// <summary>
        /// The numeric precision of the database column
        /// </summary>
        [Category("Data Type")]
        public int NumericPrecision
        {
            get { return this._NumericPrecision; }
            set { this._NumericPrecision = value; }
        }
        /// <summary>
        /// The numeric scale of the database column
        /// </summary>
        [Category("Data Type")]
        public int NumericScale
        {
            get { return this._NumericScale; }
            set { this._NumericScale = value; }
        }
        /// <summary>
        /// True if the database column is an identity column
        /// </summary>
        [Category("Attributes")]
        public bool IsIdentity
        {
            get { return this._IsIdentity; }
            set { this._IsIdentity = value; }
        }
        /// <summary>
        /// The name of the database type for the database column
        /// </summary>
        /// <example>
        /// MS SQL Server 2000: "VARCHAR"
        /// MS ACCESS 2007: "Text"
        /// MySQL: "varchar"
        /// </example>
        [Category("Data Type")]
        public string DatabaseTypeName
        {
            get { return this._DatabaseTypeName; }
            set { this._DatabaseTypeName = value; }
        }
        /// <summary>
        /// The full declaritive name of the database type for the database column
        /// </summary>
        /// <example>
        /// MS SQL Server 2000: "VARCHAR(50)"
        /// </example>
        [Category("Data Type")]
        public string DatabaseTypeDeclaration
        {
            get { return this._DatabaseTypeDeclaration; }
            set { this._DatabaseTypeDeclaration = value; }
        }
    }
}
